﻿using Axial;
using Axial.DOM;

namespace AxialWeb
{
	public partial class JSWindow : System.Web.UI.Page
	{
		public void TestTimeout()
		{
			Window.SetTimeout(() => lblTimeoutIn2.Text = "Prompt works, trust me", 2000);
		}

		public void TestInterval()
		{
			Window.SetInterval(() => lblIntervalIn1.Text = (int.Parse(lblIntervalIn1.Text) + 1).ToString(), 500);
		}

		public void TestDocument()
		{
			Document.GetElementById("plain").InnerHTML = "I work too!";
			Document.GetElementById("plain").Style["color"] = "green";
			var kid = Document.CreateElement("span");
			kid.InnerHTML = "form id: " + Document.Forms[0].Id;
			Document.GetElementById("plain").AppendChild(kid);
			Document.Images["blankimg"].Src = "dog.gif";
			Document.Anchors[0].Href = "default.aspx";
			Document.Links[0].Href = "default.aspx";
			//Window.Alert(Document.Body.InnerHTML);
			//Window.Alert(Document.GetElementsByTagName("div")[0].NodeName);
			//Window.Alert(Document.Cookie);
			//Window.Alert(Document.Domain);
			//Window.Alert(Document.LastModified);
			//Window.Alert(Document.Referrer);
			//Window.Alert(Document.Title);
			//Window.Alert(Document.URL);
		}
	}
}
